package com.kcht.sylyg08.dao.impl;

import com.kcht.adp.common.sql.JPAConfig;
import com.kcht.sylyg08.dao.DataSourceBaseDao;
import com.kcht.sylyg08.dao.ICommandTempDao;
import com.kcth.sylyg08.entity.CommandTemp;

import javax.ejb.Singleton;
import javax.ejb.Startup;

/**
 * @program: G08ProductionLine
 * @description
 * @author: X.Gao
 * @create: 2019-08-09 11:10
 **/

@Singleton
@Startup
@JPAConfig(dynaSqlFile = "mapper/commandTempMapper.xml")
public class CommandTempDao extends DataSourceBaseDao<CommandTemp, Long> implements ICommandTempDao {

    @Override
    public CommandTemp selectOneTempRecord(String epcCode) {
        return selectOneByJPQL("select a from CommandTemp a where a.epcCode='" + epcCode+"'");
    }

    @Override
    public CommandTemp updateCheckNum(CommandTemp commandTemp) {
        return selectOneByJPQL("update CommandTemp set checkNum = " + commandTemp.getCheckNum() + "  where epcCode = '" + commandTemp.getEpcCode()+"'");
    }

}
